﻿@model RonYee.Models.Order

@{
    ViewBag.Title = "订单详细";
    Layout = "~/Views/Shared/_LayoutOfSecondPage.cshtml";
}


<div class="box_padding">
    <h3><i class="ui-icons"></i>订单详细</h3>
    <div class="box_top ui-icons"></div>
    <div class="box_bg"><div class="box_padding">
    <div class="border_line">
        <table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody>
        <tr>
          <th class="tdName">编号</th>
          <th class="tdName">提交人</th>
          <th class="tdName">学 号</th>
          <th class="tdName">状 态</th>
          <th class="tdName">联系方式</th>
          <th class="tdName">提交日期</th>
          <th class="tdName">总 价</th>
        </tr>
        <tr>
          <td class="tdData">@Html.DisplayFor(model => model.OrderId)</td>
          <td class="tdData">@Html.DisplayFor(model => model.Username)</td>
          <td class="tdData">@Html.DisplayFor(model => model.UserNo)</td>
          <td class="tdData">
              @Enum.GetName(typeof(RonYee.Models.Enum.OrderState),Convert.ToInt32(Model.Status))
          </td>
          <td class="tdData">@Html.DisplayFor(model => model.Phone)</td>
          <td class="tdData">@Html.DisplayFor(model => model.OrderDate)</td>
          <td class="tdData">@Html.DisplayFor(model => model.Total)</td>
        </tr>
        </tbody></table></div>
    </div></div>
    <div class="box_down ui-icons"></div>
    <h3><i class="ui-icons"></i>图书列表</h3>
    <div class="box_top ui-icons"></div>
    <div class="box_bg"><div class="box_padding">
    <div class="border_line">
        <table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody>
        <tr>
          <th class="tdName">编号</th>
          <th class="tdName">ISBN</th>
          <th class="tdName">书名</th>
          <th class="tdName">数量</th>
          <th class="tdName">价格</th>
        </tr>
        @foreach (var item in (IEnumerable<RonYee.Models.OrderDetail>)ViewData["details"])
        { 
            <tr>
              <td class="tdData">
                 @item.OrderId
              </td>
              <td class="tdData">
                 @item.ISBN
              </td>
              <td class="tdData">
                 @item.BookName
              </td>
              <td class="tdData">
                 @item.Quantity
              </td>
              <td class="tdData">
                 @item.UnitPrice
              </td>
            </tr>
        }
        </tbody></table></div>
    </div></div>
    <div class="box_down ui-icons"></div>
</div>

<div class="line_top">
@{
    int status = ViewBag.status;
    if (status == 0)
    {
        <a href="@Url.Action("ApprovedTheOrder", "Order", new { id = Model.OrderId })"><input type="button" id="Approve" value="同意" class="Button1 ui-icons" /></a> 
        <a href="@Url.Action("RevokedTheOrder", "Order", new { id = Model.OrderId })"><input type="button" id="Rejected" value="拒绝" class="Button1 ui-icons" /></a>
    }
    else if (status == 1)
    {
        <a href="@Url.Action("ToCloseOrder", "Order", new { id = Model.OrderId })"><input type="button" id="Closed" value="交易成功" class="Button1 ui-icons" /></a> 
        <a href="@Url.Action("RejectedTheOrder", "Order", new { id = Model.OrderId })"><input type="button" id="Revoked" value="撤销订单" class="Button1 ui-icons" /></a>
    }
}
<br />
@ViewBag.Error
</div>


